package com.service.mybatis.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;


/**
 * 公共父类
 * @author ccf
 * @Date 2022/3/14 20:19
 */
@Setter
@Getter
@NoArgsConstructor
public class SuperEntity extends IdEntity {

    public SuperEntity(String id) {
        super(id);
    }

    public static final String CREATE_TIME_FIELD = "create_time";

    public static final String UPDATE_TIME_FIELD = "update_time";

    /**
     * 创建时间
     *  创建时生成，修改时不动
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

}
